import { getRequestConfig } from 'next-intl/server';
import { cookies } from 'next/headers';

export default getRequestConfig (async () => {
  const cookieStore = await cookies();
  console.log(cookieStore.get('locale'), 'cookieStore');
  const locale = cookieStore.get('locale')?.value || 'zh';
  return {
    locale,
    messages: (await import(`../messages/${locale}/message.json`)).default,
  };
});